package cn.openea.perpartner.meily.web.convert;

import cn.openea.perpartner.meily.web.entity.dto.MenuTreeDto;
import cn.openea.perpartner.meily.web.entity.vo.MenuTree;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;
import org.mapstruct.factory.Mappers;

/**
 * @author Weird077
 * @description TODO
 * @date 2023-03-23 21:56
 */

@Mapper
public interface MenuTreeConvert {
    MenuTreeConvert INSTANCE = Mappers.getMapper(MenuTreeConvert.class);
    @Mappings({@Mapping(source = "menuId", target = "id"),
            @Mapping(source = "title", target = "title"),
            @Mapping(source = "href", target = "href"),
            @Mapping(source = "checked", target = "checked"),
            @Mapping(source = "child", target = "children")})
    MenuTreeDto toDto(MenuTree menuTree);
}
